home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Language / Compiler / Builtins / Boolean.m < prev    next >
Text File  |  1990-08-16  |  2KB  |  68 lines

  1. % @(#)Boolean.m    1.2  6/29/87
  2. %
  3. export _BooleanObject to "Builtins"
  4.  
  5. const _BooleanObject == immutable object _BooleanObject
  6.   export getSignature, makeTrue, makeFalse
  7.   
  8.   const BooleanType == immutable type BooleanType
  9.     function > [o : Boolean] -> [r : Boolean]
  10.     function >=[o : Boolean] -> [r : Boolean]
  11.     function < [o : Boolean] -> [r : Boolean]
  12.     function <=[o : Boolean] -> [r : Boolean]
  13.     function = [o : Boolean] -> [r : Boolean]
  14.     function !=[o : Boolean] -> [r : Boolean]
  15.     function & [o : Boolean] -> [r : Boolean]
  16.     function | [o : Boolean] -> [r : Boolean]
  17.     function ! -> [r : Boolean]
  18.     function asString -> [s : String]
  19.       % s <- either "true" or "false"
  20.   end BooleanType
  21.   function getSignature -> [result : Signature]
  22.     result <- BooleanType
  23.   end getSignature
  24.   function create [data : Integer] -> [result : BooleanType]
  25.     result <- immutable object aBoolean
  26.       export >, >=, <, <=, =, !=, &, |, !, asString
  27.  
  28.       function > [o : Boolean] -> [r : Boolean]
  29.     primitive 003 [r] <- [o]
  30.       end >
  31.       function >= [o : Boolean] -> [r : Boolean]
  32.     primitive 103 [r] <- [o]
  33.       end >=
  34.       function < [o : Boolean] -> [r : Boolean]
  35.     primitive 203 [r] <- [o]
  36.       end <
  37.       function <= [o : Boolean] -> [r : Boolean]
  38.     primitive 303 [r] <- [o]
  39.       end <=
  40.       function = [o : Boolean] -> [r : Boolean]
  41.     primitive 403 [r] <- [o]
  42.       end =
  43.       function != [o : Boolean] -> [r : Boolean]
  44.     primitive 503 [r] <- [o]
  45.       end !=
  46.       function & [o : Boolean] -> [r : Boolean]
  47.     primitive 603 [r] <- [o]
  48.       end &
  49.       function | [o : Boolean] -> [r : Boolean]
  50.     primitive 703 [r] <- [o]
  51.       end |
  52.       function ! -> [r : Boolean]
  53.     primitive 803 [r] <- []
  54.       end !
  55.       function asString -> [r : String]
  56.     primitive 903 [r] <- []
  57.       end asString
  58.     end aBoolean
  59.   end create
  60.   function makeTrue -> [result : BooleanType]
  61.     result <- true
  62.   end makeTrue
  63.   function makeFalse -> [result : BooleanType]
  64.     result <- false
  65.   end makeFalse
  66. end _BooleanObject
  67.